# class A:
#
#     class_name = 'python23期'
#
#     def __init__(self, name, age):
#
#         self.name = name
#         self.age =age
#
# a1 = A('李业', 21)
# print(a1.name)
#
# a2 = A('李东宇', 24)
# print(a2.age)


# 多态:
# python中 定义变量不用规定变量的类型.
# a = 'alex'
# a = [1, 2, 3]
# a = (22, 33)
# def func(a:int):
#     print(a)
# func('fdsa')


# java:

# int a = 12
# String b = 'dfsaf'


'''
def func(int a):
    print(a)


'''


# 鸭子类型(面试会问到)
# python中


# class A:
#
#     def login(self):
#         pass
#
#     def register(self):
#         pass
#
#
# class B:
#
#     def login(self):
#         pass
#
#     def register(self):
#         pass

# A,B两个类,没有任何关系,独立两个,但是里面的功能相似,所以python一般会将类似于A,B两个类
# 里面的相似的功能让其命名相同.
# 1. A,B虽然无关系,但是很默契的制定了一个规范.让你使用起来更方便.
'''
class Str:
    def index():
        pass
    def count():
        pass    
        
        
class List:
    def index():
        pass
    def count():
        pass 
'''


# super()

#
# class A:
#     def f1(self):
#         print('in A f1')
#
#     def f2(self):
#         print('in A f2')
#
#
# class Foo(A):
#     def f1(self):
#         # super().f2()
#         super(Foo, self).f2()
#         print('in A Foo')
#
#
# obj = Foo()
# obj.f1()
#


# class A:
#     def f1(self):
#         print('in A')
#
# class Foo(A):
#     def f1(self):
#         super(Foo,self).f1()
#         print('in Foo')  # 2
#
# class Bar(A):
#     def f1(self):
#         print('in Bar')  # 1
#
# class Info(Foo,Bar):
#
#     def f1(self):
#         super(Info,self).f1()
#         print('in Info f1')  # 3
#
# obj = Info()
# print(Info.mro())  # [Info, Foo, Bar, A]
# obj.f1()

# super() 严格意义并不是执行父类的方法.
# 单继承: super() 肯定是执行父类的方法.
# 多继承: super(S,self) 严格按照self从属于的类的mro的执行顺序,执行 S类的下一位.



class A:
    def f1(self):
        print('in A')

class Foo(A):

    def f1(self):
        super().f1()
        print('in Foo')

class Bar(A):

    def f1(self):  # self = obj
        print('in Bar')

class Info(Foo,Bar):

    def f1(self):  # self = obj
        super(Foo,self).f1()
        print('in Info f1')

obj = Info()  # [Info, Foo, Bar, A]
obj.f1()
# 多继承: super(S,self) 严格按照self从属于的类的mro的执行顺序,执行 S类的下一位.